package com.example.baiduocr;


import java.util.*;

import com.baidu.aip.imageclassify.AipImageClassify;
import org.json.JSONObject;
public class Sample {
    //设置APPID/AK/SK
    public static final String APP_ID = "119396512-";
    public static final String API_KEY = "aBt4We9tYFxbLFRFhmTvhI5B";
    public static final String SECRET_KEY = "2A0lBqf0ztfl5H1iaMWiJ0NieaQi54WP";

    public static void main(String[] args) {
            // 初始化一个AipImageClassify
            AipImageClassify client = new AipImageClassify(APP_ID, API_KEY, SECRET_KEY);

            // 可选：设置网络连接参数
            client.setConnectionTimeoutInMillis(2000);
            client.setSocketTimeoutInMillis(60000);

            // 调用接口
            String path = "D:\\桌面\\test.jpg";
            JSONObject res = client.objectDetect(path, new HashMap<String, String>());
            System.out.println(res.toString(2));

    }
}
